﻿using System;
using UnityEngine;
using UnityEngine.EventSystems;

namespace UniRx.Triggers
{
	// Token: 0x0200042F RID: 1071
	[DisallowMultipleComponent]
	public class ObservableDropTrigger : ObservableTriggerBase, IEventSystemHandler, IDropHandler
	{
		// Token: 0x0600165F RID: 5727 RVA: 0x00061748 File Offset: 0x0005FB48
		void IDropHandler.OnDrop(PointerEventData eventData)
		{
			if (this.onDrop != null)
			{
				this.onDrop.OnNext(eventData);
			}
		}

		// Token: 0x06001660 RID: 5728 RVA: 0x00061764 File Offset: 0x0005FB64
		public IObservable<PointerEventData> OnDropAsObservable()
		{
			Subject<PointerEventData> result;
			if ((result = this.onDrop) == null)
			{
				result = (this.onDrop = new Subject<PointerEventData>());
			}
			return result;
		}

		// Token: 0x06001661 RID: 5729 RVA: 0x0006178C File Offset: 0x0005FB8C
		protected override void RaiseOnCompletedOnDestroy()
		{
			if (this.onDrop != null)
			{
				this.onDrop.OnCompleted();
			}
		}

		// Token: 0x04000C98 RID: 3224
		private Subject<PointerEventData> onDrop;
	}
}
